package Client.GUI;

import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;

import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.JLabel;

import Client.logic.ClientIF;
import javax.swing.JTextPane;
import java.awt.Font;
import java.awt.Color;

public class HomePanelParent extends MyJPanel{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String str;

	public HomePanelParent(ClientIF client) {
		super(PanelType.HOME_PANEL_PARENT, client);
		
		BufferedImage myPic;
		try {
			myPic = ImageIO.read(new File("images"+ File.separator+"home.jpg"));
		
			JLabel lblAddClass = new JLabel(new ImageIcon(myPic), JLabel.CENTER);
			lblAddClass.setBounds(12, 13, 562, 99);
			add(lblAddClass);
		
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		setLayout(null);
		str = getClient().getUser().toString();
		JTextPane txtpnHelloDearParent = new JTextPane();
		txtpnHelloDearParent.setForeground(Color.GRAY);
		txtpnHelloDearParent.setFont(new Font("High Tower Text", Font.PLAIN, 50));
		txtpnHelloDearParent.setText("Hello "+str+"\r\n     welcome to\r\nMatSchool System.\r\n\r\n     Parent User");
		txtpnHelloDearParent.setBounds(123, 133, 448, 349);
		add(txtpnHelloDearParent);
	}
	

	@Override
	public MyJPanel pushPanel() {
		return new HomePanelParent(getClient());
	}
}
